<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<title>后台管理系统</title>
<link rel="stylesheet" href="__PUBLIC__/Admin/css/css.css">
<script src="__PUBLIC__/Admin/js/jquery-1.9.1.js"></script>
<script src="__PUBLIC__/Common/Layer/layer.js"></script>
<script>
//删除用户
/*function del(id){
	$("#del"+id+" td").css('background','#CBDFF2');
	parent.layer.confirm('真的要删除吗？', {
		btn: ['确认','取消'], //按钮
		shade: 0.5 //显示遮罩
	}, function(){
		$.post("{:U('Goods/goods_orders_del')}", { "id": id},function(data){
			console.log(data);
			if(data == 1){
				parent.layer.msg('删除成功', { icon: 1, time: 1000 }, function(){
						$("#del"+id).remove();
					});
			}else{
				parent.layer.msg('删除失败', {icon: 2, time: 2000 }); 
			}
		}, "json");
	},function(){
		$("#del"+id+" td").css('border-top','0');
		$("#del"+id+" td").css('border-bottom','1px solid #EFEFEF');
	});
}
//编辑
function edit(id){
	parent.layer.open({
		type: 2,
		shadeClose: true,
		shade: 0.5,
		area: ['1000px', '90%'],
		title: '订单详情管理',
		content: "{:U('Goods/orders_edit')}?id="+id
	});
}
//发货
function orders_fahuo(id){
	parent.layer.open({
		type: 2,
		shadeClose: true,
		shade: 0.5,
		area: ['500px', '350px'],
		title: '发货',
		content: "{:U('Goods/orders_fahuo')}?id="+id
	});
}*/

//查看详情
	function look_detail(id){
		parent.layer.open({
			type: 2,
			title: '批量导出订单',
			shadeClose: true,
			shade: 0.5,
			maxmin: true,
			area: ['80%', '80%'],
			content: "{:U('Goods/order_lst_detail')}?id="+id //iframe的url
		});
	}
	function refresh(){
		window.location.href="{:U('Goods/orders_list')}"
	}

</script>
</head>
<body>
<style>
	.tr_content {
		line-height: 32px;
		height:32px;
		font-size: 14px;
	}
</style>
<div class="nav">
	<div class="nav_title">
    	<h4><img class="nav_img" src="__PUBLIC__/Admin/img/tab.gif" /><span class="nav_a">用户管理 - 商城订单列表</span></h4>
    </div>
</div>

<form action="__SELF__" method="get">
	<div class="search" style=" line-height:50px; padding-left:30px; margin-top:3px;">
	订单编号：<input type="text" class="input" name="realname" value="" maxlength="30" size="20" />
		  &nbsp;&nbsp;
		 手机号： <input type="text" class="input" name="mobile" value="" maxlength="30" size="20" />&nbsp;&nbsp;
		<select name="pay_status" style="height:30px; text-align: center">
			<option value="">-----全部----</option>
			<option value="1">已支付</option>
			<option value="0">待支付</option>
		 </select>&nbsp;&nbsp;
		<button type="submit" class="button">查 询</button>
		<button type="button" class="button" onclick="refresh()">刷 新</button>
		<button type="button" class="button" onclick="show()">查询快递单号</button>
		<!--<button type="button" class="button" onClick="export_orders();" style="background:#146AC1;">批量导出订单</button>-->
	</div>
</form>
<script>
	function show(){
		parent.layer.open({
			type: 2,
			shadeClose: true,
			shade: 0.5,
			area: ['800px', '500px'],
			title: '查询快递单号',
			content: '__ROOT__/kuaidi100/example.html',
		});
	}
</script>

<div class="list">
	  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="list_table">
      <thead>
	    <tr>
	      <td width="7%"><div align="center">ID</div></td>
	      <td width="8%"><div align="center">姓名 </div></td>
	      <td width="11%"><div align="center">订单编号</div></td>
	      <td width="10%"><div align="center">手机号</div></td>
	      <td width="12%"><div align="center">快递公司</div></td>
	      <td width="12%"><div align="center">快递单号</div></td>
	      <td width="8%"><div align="center">支付状态</div></td>
	      <td width="6%"><div align="center">订单状态</div></td>
	      <td width="12%"><div align="center">发货</div></td>
			<td width="14%"><div align="center">操作</div></td>

        </tr>
        </thead>
        <tbody>
        <foreach name="res" item="vo">
	  		<tr class="tr_content">
	  		  <td width="7%" style="height: 40px"><div align="center">{$vo.id}</div></td>
			
				<td width="8%" style="height: 40px"><div align="center">{$vo.realname}</div></td>
				<td width="11%"><div align="center">{$vo.orders_num}</div></td>
				<td width="10%"><div align="center">{$vo.mobile}</div></td>
				<td><div align="center">{$vo.kuaidi_name}</div></td>
				<td><div align="center">{$vo.kuaidi_num}</div></td>
				<td width="8%"><div align="center">
				  <if condition="$vo['pay_status'] eq 1">
						已付款
					 <elseif condition="$vo['pay_status'] eq 2"/>
					 待收货
					 <elseif condition="$vo['pay_status'] eq 3"/>
					 待评价
				    <else />
				    未付款</if>
				  </div></td>
				<td width="6%"><div align="center">
				  <if condition="$vo['orders_status'] eq 1">已发货
				    <elseif condition="$vo['orders_status'] eq -1"/>
				    取消订单
				    <else />
				    正常</if>
				  </div></td>
				<td width="12%">
				<div align="center">
					<if condition="$vo.kuaidi_num eq ''">
						<button class="button" onclick="add({$vo.id})">发货</button>
					<else/>{$vo.fahuo_time|date="H-m-d H:i:s",###}<br/><button class="button" onclick="show_info('{$vo.kuaidi_name}',{$vo.kuaidi_num})">快递查询</button>
					</if>
				</div>
				</td>
				<td width="14%"><div align="center">				
				<a href="javascript:void (0);" style=" background-color: #146AC1; padding: 8px; border-radius: 4px; color: #ffffff" onclick="look_detail({$vo.id})">详情</a> </div></td>
			</tr>
	  		<tr class="tr_content" style="background:#EFF7FE;">
	  		  <td><div align="center">发货地址：</div></td>
	  		  <td colspan="7">{$vo.user_address}</td>
	  		  <td>&nbsp;</td>
	  		  <td>&nbsp;</td>
  		  </tr>
        </foreach>
        </tbody>
		<script>
	function add(a){
	parent.layer.open({
		type: 2,
		shadeClose: true,
		shade: 0.5,
		area: ['450px', '250px'],
		title: '添加发货信息',
		content: '{:U("Goods/kuaidi_add")}?id='+a,
	});
}

function show_info(a,b){
		parent.layer.open({
			type: 2,
			shadeClose: true,
			shade: 0.5,
			area: ['540px', '480px'],
			title: '查询快递单号',
			content: '__ROOT__/kuaidi100/get.php?com='+a+'&nu='+b,
		});
	}
	
</script>
  </table>
</div>

<!-- 分页 -->
<div class="page">
{$page}
</div>


</body>
</html>
